#include <stdio.h>
#include <stdlib.h>

int main ()
{
	int x1, y1, x2, y2;

	scanf("%d %d", &x1, &y1);
	scanf("%d %d", &x2, &y2);
	x2 = x2 - x1;
	y2 = y2 - y1;
	//printf(" X = %d\n Y = %d\n", x2, y2);
	if (( (y2 % 2 == 0) && (x2 % 2 == 0) ) || ( (abs(y2 % 2) == 1) && (abs(x2 % 2) == 1) )) { // Whether or not we can teleport.
		if ((x2 == 0) && (y2 == 0)) {
			printf("0\n");
		} else if (abs(x2) == abs(y2)) {
			printf("1\n");
		} else if ( ((x2 == 0) || (y2 == 0) || (abs(x2-y2) % 2 ==0)) && (abs(x2 % 2) == 0) && (abs(y2 % 2) == 0) ) {
			printf("2\n");
		} else {
			printf("3\n");
		}
	} else {
		printf("0\n");
	}
	return 0;
}
